public class Course {
    private String courseId;
    private String courseName;
    private String location;
    private String time;
    private Teacher teacher;

    public Course(String courseId, String courseName, String location, String time) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.location = location;
        this.time = time;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public String getCourseName() {
        return courseName;
    }

    public void displayInfo() {
        System.out.println("课程编号: " + courseId);
        System.out.println("课程: " + courseName);
        System.out.println("地点: " + location);
        System.out.println("时间: " + time);
        if (teacher != null) {
            System.out.println("教师: " + teacher.getName());
        } else {
            System.out.println("教师: 未分配");
        }
        System.out.println("------------");
    }
}